package com.cg.client;

import com.alibaba.nacos.api.model.v2.Result;
import com.cg.dto.OrderPageDto;
import com.cg.dto.PayDto;
import com.cg.entity.User;
import com.cg.vo.LoginUserVo;
import com.cg.vo.PatientOrderVo;
import com.cg.vo.PayOrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;
@FeignClient(name = "order-provider")
public interface OrderClient {

    /**
     * 预约信息列表
     */
    @PostMapping("/order/queryOrderList")
    public Result<Map<String,Object>> queryOrderList(@RequestBody OrderPageDto orderPageDto);


    /**
     * 添加新用户
     */
    @PostMapping("/user/createUser")
    public Result createUser(@RequestBody User user);

    /**
     * 用户登录
     */
    @PostMapping("/user/login")
    public Result<LoginUserVo> login(@RequestBody User user);


    /**
     * 获取患者信息及其预约信息
     */
    @PostMapping("/order/queryPatientOrder")
    public Result<PatientOrderVo> queryPatientOrder(@RequestBody OrderPageDto orderPageDto);

    /**
     * 取号前查询订单支付方式
     */
    @GetMapping("/order/getPayOrderByOrderNum")
    public Result<PayOrderVo> getPayOrderByOrderNum(@RequestParam("orderNum") String orderNum);

    /**
     * 去支付
     */
    @PostMapping("/order/toPay")
    public Result<String> toPay(@RequestBody PayDto payDto);
}
